package com.a;

public class f {
    public static void main(String[] args) {

        int[] arr1= {10,20,30};
        int[] arr2= {10,20,30,40};

        System.out.println(equals(arr1, arr2));

    }
    public static boolean equals(int[] arr1,int[] arr2)
    {

        if(arr1==null&&arr2==null)
        {
            System.out.println("arr1==arr2");
            return true;
        }
        if(arr1==null||arr2==null)
        {
            System.out.println("no equal");
            return false;
        }
        if(arr1.length!=arr2.length)
        {
            System.out.println("no equal");
            return false;
        }

        for(int i=0;i<arr1.length;i++)
        {
            if(arr1[i]!=arr2[i])
            {
                return false;
            }
        }return true;
    }
}
